package net.lab1024.sa.admin.module.upstream.api.painet.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ProcessStatusEnum {

    AUDIT("audit", "待审核"),
    DEPLOYING("deploying", "待部署"),
    SERVING("serving", "服务中"),
    UNUSABLE("unusable", "不可用"),
    ;

    private final String status;

    private final String desc;

    public static String getDescByStatus(String status) {
        for (ProcessStatusEnum processStatusEnum : ProcessStatusEnum.values()) {
            if (processStatusEnum.getStatus().equals(status)) {
                return processStatusEnum.getDesc();
            }
        }
        return null;
    }
}
